<%@ page contentType="text/html;charset=gb2312"%> 
<%@ page import="java.io.File, java.text.SimpleDateFormat
	, git.bankview.sl.servlet.MultipartPostRequestAdapter
	, git.bankview.wl.servlet.FileUploadProgressListener
	, git.bankview.wl.excel.ExcelDBImporter
	, git.bankview.sl.auth.AuthHelper
	, git.bankview.sl.report.ReportCommon" %>

<jsp:useBean id="oLogon" class="git.bankview.wl.bean.LogonBean" scope="session" />
<%
	MultipartPostRequestAdapter mpRequest = new MultipartPostRequestAdapter(request);
	String oTransId = mpRequest.getParameter("transid");
	
	git.bankview.wl.auth.UserAuth.validate(oLogon, oTransId, ReportCommon.METHOD_MODIFY);

	String oDateKeyStr = "2006-12-31";
	String oUserId = oLogon.getUsername();
	String oDeptId = AuthHelper.getDeptIdByUserId(oUserId);
	
	String oUploadFilename = mpRequest.getParameter("uploadFile");
	File oUploadFile = mpRequest.getUploadFile("uploadFile");
	long nFileLen = oUploadFile.length();
	String oLenMsg = "";
	
	if (0 < nFileLen)
	{
		oLenMsg = (oUploadFile.length() / 1024) + " KB";
		
		new ExcelDBImporter(new java.sql.Date(new SimpleDateFormat("yyyy-MM-dd").parse(oDateKeyStr).getTime()), 
			oDeptId, oUserId, 20).importFromExcel(oTransId, oUploadFile, null);
	}
%>

<html>
<head>
<title>INPUT EXCEL UPLOAD PAGE</title>
</head>
<body onload="parent.onUploadFinished(<%=nFileLen%>);"> 
</body>
</html> 
